<?php
class LZ_Config extends LZ_Model
{
	function LZ_Config()
	{
		$this->table = LZ_MYSQL_PREFIX.'config';
		$this->id = 'config_id';
		$this->order_id = 'order_id';
	}
	
	function get($name)
	{
		global $db;
		$sql = make_select_sql($this->table, array(
			'name' => $name,
		));
		return $db->get_one($sql);
	}
	
	function get_group_list()
	{
		global $db;
		$sql = "SELECT `group` FROM `lz_config` GROUP BY `group` ORDER BY SUM(order_id) DESC";
		return $db->get_all($sql);
	}
}
?>